<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta name="screen-orientation" content="portrait">
    <meta name="x5-orientation" content="portrait">
    <title>邀请收银员</title>
    <link rel="stylesheet" href="../../styles/h5/reset.min.css"/>
    <link rel="stylesheet" href="../../styles/h5/errortankuang.css"/>
    <!--以上为公共css样式-->
    <link rel="stylesheet" href="../../styles/h5/index.css"/>

    <script charset="utf-8" type="text/javascript" src="../../scripts/h5/jquery-1.9.1.min.js"></script>
    <script charset="utf-8" type="text/javascript" src="../../scripts/h5/jquery.modal.js"></script>
    <!--以上为公共js文件-->
</head>
<body>
<div class="zz-top"></div>
<div class="zz-request-cashier">
    <div class="zz-place">
        请收银员使用微信扫描该二维码，关注“享云管家”公众号即可
    </div>
    <span class="zz-shop-name">
        小西天店 - 张三
    </span>
    <img class="zz-ewm" src="" alt=""/>
</div>
<input class="footer zz-footTop" type="button" value="发送">
<a class="zz-close" href="javascript:;">关闭</a>
<div class="zz-not-scanning">
    不能当面扫码时，可以将此二维码转发给收银员，对方需要在24小时内完成操作。
</div>
<div class="zz-send-mask" style="display: none"></div>
</body>
<script charset="utf-8" type="text/javascript" src="../../scripts/h5/utils.js"></script>
<script charset="utf-8" type="text/javascript" src="../../scripts/h5/public.js"></script>
<script charset="utf-8" type="text/javascript">
	utils.countRem();
	$(window).resize(function () {
		utils.countRem();
	});

    var queryURLParameter = utils.queryURLParameter();
    var toreShortName = queryURLParameter.toreShortName;
    var storeId = queryURLParameter.storeId;
    var userId = queryURLParameter.userId;
    var name = queryURLParameter.name;
    var $close = $(".zz-close");
    var $footer = $(".footer");
    var str = '';
    
    str += toreShortName;
    str += ' - ';
    str += name;
    $(".zz-shop-name").html(str);
    
    var getStoreId = localStorage.getItem("storeId");
    if(getStoreId === storeId){
    	$close.show();
    	//$footer.show();
    } else {
    	$close.hide();
    	//$footer.hide();
    }
    
    //初始化二维码
    $.ajax({
        url: utils.ajaxUrl()+"h5/cashier/receiver/inviteCashier",
        async: false,
        data:{
        	userId:userId
        },
        type: 'get',
        success: function (res) {
        	//console.log(res);
            if (res && res.retCode == '0000') {
            	$(".zz-ewm").attr("src",res.ticket)
            }else {
                new $.modal({
                    content: res.retMsg,//弹框内容
                    showcontent: true,//false为弹出框组件二，true为弹出框组件一

                }).show();
            }
        }
    });

    $footer.click(function () {
        $(".zz-send-mask").show();
    });
    $(".zz-send-mask").click(function () {
        $(this).hide();
    });
	
    $close.attr("href", "../../html/h5/cashierAdmin.html?storeId=" + storeId + "&toreShortName=" + queryURLParameter.toreShortName);
</script>
</html>